﻿<?php

class Application_Form_Evento extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
		$this->addDecorator('FormElements')        	
			->addDecorator('Form');

        $hiddenId = new Zend_Form_Element_Hidden("id");
			
		$textTitle = new Zend_Form_Element_Text('titulo');
		$textTitle
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->setAttribs(array('placeholder'=>'Escribe el título del evento'))
			->setLabel('Título:');
			
		$textAreaDescription = new Zend_Form_Element_Textarea('descripcion');
		$textAreaDescription
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->setAttribs(array('placeholder'=>'Escribe una descripción del evento','class'=>'autogrow','rows'=>'1'))
			->setLabel('Descripción:');
			
		$textPlace = new Zend_Form_Element_Text('lugar');
		$textPlace
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->setAttribs(array('placeholder'=>'Escribe el lugar del evento'))
			->setLabel('Lugar:');
			
		$textDataTime = new Zend_Form_Element_Text('fecha');
		$textDataTime
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field small'))
			->setAttribs(array('class'=>'datetimepicker','data-icon'=>'clock'))
			->setLabel('Fecha y Hora:');
			
		$checkBoxMain = new Zend_Form_Element_Checkbox('principal');
		$checkBoxMain
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field list'))
			->setLabel('Evento Principal del Día:');									

        $submitForm = new Zend_Form_Element_Submit('submit');
		$submitForm
			->setDecorators(array('ViewHelper'))
			->addDecorator('Description',array('escape'=>false,'tag'=>'div','openOnly'=>true,'placement'=>'prepend'))
			->setAttribs(array('class'=>'bt blue'))
			->setDescription('<footer class="pane">')				
			->setLabel('Publicar');
			
        $resetForm = new Zend_Form_Element_Reset('reset');
		$resetForm
			->setDecorators(array('ViewHelper'))
			->addDecorator('Description',array('escape'=>false,'tag'=>'div','closeOnly'=>true))
			->setAttribs(array('class'=>'bt orange'))
			->setDescription('</footer>')				
			->setLabel('Limpiar');			
		
		$this->addElements( array (
            $hiddenId,
			$textTitle,
			$textAreaDescription,
			$textPlace,
			$textDataTime,
			$checkBoxMain,
			$submitForm,
			$resetForm
		));			
		
    }

}